<%@ page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<div id="wrapforgot">
	<div id="wrapforgottop"></div>
	<div id="wrapforgotmiddle">
		<h2>비밀번호 찾기</h2><br/>
		<form id="forgot_form">
			<input type="email" id="forgot_account" placeholder="계정(Email)" required> 
			<input type="submit" id="forgot_submit" value="새 비밀번호 보내기">
		</form>
	</div>
	<div id="wrapforgotbottom"></div>
</div>
<c:if test="${!empty message}">
	<div id="wrapforgotmsg">${message}</div>
</c:if>

<script>
	$(document).ready(function() {
		$('#forgot_account').focus();
	});
	
	$('#forgot_form').submit(function() {
		$.ajax({
			url : 'forgot.action',
			type : 'POST',
			data : {
				account : $('#forgot_account').val(),
			},
			dataType : 'html',
			success : function(html) {
				$('#wrapadd').html(html);
			},
			error : function(xhr, ajaxOptions, thrownError) {
				alert('An error occurred! ' + thrownError);
			},
		});
		return false;
	});
</script>
